home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CUCD / Online / ACS-Notify / NotifyArexx.amicomsys < prev   
Encoding:
Text File  |  1998-02-01  |  4.1 KB  |  159 lines

  1. /*
  2. $VER: Notify User [Arexx script] V0.41 (02-02-98) © Copex - aWo
  3.  
  4. Bug Reports ect to -: copex@online.u-net.com
  5. Uppdates/Bugfixes :- http:www.online.u-net.com/updates/
  6.  
  7. NOTE -: This Rexx Script is now EMAIL Ware, If you Use it You SHOULD Email
  8.         Me ......*/
  9.  
  10. player = 'RUN <>NIL: C:Play16'
  11. soundfileC = 'Internet:amicom/NTFC.SND'
  12. soundfileD = 'Internet:amicom/NTFD.SND'
  13. PlaySonud = 'Yes'
  14.  
  15. user.0 = 'Po' 
  16. user.1 = 'LaLa'
  17. user.2 = 'Tinky Winky'
  18. user.3 = 'Dispy'
  19. user.4 = 'TellyTubbies'
  20. user.5 = 'NoOne'
  21.  
  22. NumberOfUsers = 5
  23.  
  24. ShowReqC = 'yes'
  25. ShowReqD = 'yes'
  26. UseAmirc = 'yes'
  27.  
  28. UseGeatz = 'yes'
  29.  
  30. NoGreatzTo = 'Tibb Copex hparting' /* NEW - See Docs */
  31.  
  32. Greatings.0 = 'Hi there %n^ It^s Good to see you again'
  33. Greatings.1 = 'Hello %n^ how are you today'
  34. Greatings.2 = 'Hello %n^ are you haveing a good day'
  35. Greatings.3 = 'Hello %n'
  36.  
  37. Gsk = 'Yes'         /* SEE DOCS */
  38. NumberOfGretz = 3
  39.  
  40. pubscr = ''
  41. ReqType = 'ACS' /* ACS = Use Amicomsys Requestor - REQT Use Reqtools Lib */
  42.  
  43. /* Do Not Tuch Any Code Below Here Unless You Know What You Are Doing .... */
  44.  
  45. ADDRESS AMICOMSYS
  46. OPTIONS RESULTS
  47.  
  48. NL = '0a'x; QU = '22'x
  49.  
  50. IF ~SHOW('LIBRARIES','rexxreqtools.library') THEN
  51. IF ~ADDLIB('rexxreqtools.library',0,-30,0) THEN EXIT(10)
  52.  
  53. tags='rt_reqpos=reqpos_centerwin' 'rtez_defaultresponse=0'
  54. if pubscr ~= '' then 'rt_pubscrname='||pubscr
  55.  
  56. parse arg usr host action
  57. act = upper(action)
  58.  
  59. GET stem info. CLIENTLIST
  60.  
  61. If usr = info.login then exit
  62.  
  63. select
  64.     when act = 'CON' then call Connecting
  65.     when act = 'DIS' then call Disconnecting
  66.     when act = 'UPD' then exit
  67.     otherwise Exit
  68.     end
  69.  
  70. Exit
  71.  
  72. /* ------------------------------------------------------------ */
  73. Connecting:
  74.     am = 0; G = 0; USRGT = 'Y'
  75.     seen = checkuser()
  76.  
  77. if seen = 1 then do
  78.  
  79.  if pp ~= 0 & upper(UseGeatz) = 'YES' then do
  80.  
  81.     R = random('0',NumberOfGretz,time(s))
  82.     Greatings = Greatings.R
  83.     pp = pos('%n',Greatings)
  84.     ndx = index(Greatings,'%n')
  85.     if ndx ~=0 then do
  86.     st = substr(Greatings,1,ndx - 1)
  87.     if ndx+2 ~> length(Greatings) then nd = substr(Greatings,ndx+2,length(Greatings)-ndx)
  88.         else nd = ' '
  89.     Greatings = st||usr||nd
  90.     Greatings = translate(Greatings,,"^","'")
  91.     end
  92.   end
  93.  
  94.         sound = Player ||" "|| SoundfileC
  95.         if upper(UseAmirc) = 'YES' then am = amirc('Connected')
  96.         If upper(PlaySonud) = "YES" Then address command sound
  97.             info = "_[_User_Name_]_-:_"||usr||NL||"_[_Host_]_-:_"||host
  98.         If upper(ShowReqC) = 'YES' & am = 0 then r = req(info' ok User_Connected')
  99.         if upper(Gsk) ~= 'YES' then Gsk = ' '
  100.         if upper(Gsk) = 'YES' then Gsk = 'ask'
  101.         if upper(UseGeatz) = 'YES' & USRGT = 'Y' Then send MSG usr QU||Greatings||QU||' '||Gsk
  102. end
  103.  
  104. return
  105. /* ------------------------------------------------------------ */
  106. Disconnecting:
  107.     am = 0
  108.     seen = checkuser()
  109.      if seen = 1 then do
  110.         sound = Player ||" "|| SoundfileD
  111.         if upper(PlaySonud) = "YES" Then address command sound
  112.         if upper(UseAmirc) = 'YES' then am = amirc('DisConnected')
  113.             info = "_[User_Name]_-:_"||usr||NL||"_[Host]_-:_"||host
  114.         if upper(ShowReqD) = 'YES' & am = 0 then r = req(info' ok User_Dissconected')
  115.      end
  116. return
  117. /* ------------------------------------------------------------ */
  118. req:
  119. arg BodyText Buttons Title 
  120. BodyText = translate(BodyText,,'_',' '); Buttons = translate(Buttons,,'_',' '); Title = translate(Title,,'_',' ')
  121. If upper(ReqType) = 'REQT' then sel=rtezrequest(BodyText,Buttons,Title,tags) */
  122. If upper(ReqType) = 'ACS' then do; BodyText = translate(BodyText,,NL,'0d'x); REQUESTA QU||Title||QU QU||Buttons||QU QU||BodyText||QU; sel = RC; End
  123. return sel
  124. /* ------------------------------------------------------------ */
  125. checkuser:
  126. x = 0
  127.  
  128. do i = 0 to NumberOfUsers
  129.  if upper(usr) = upper(user.i) then x = 1
  130. end
  131. if pos(Upper(usr),Upper(NoGreatzTo)) >0 then USRGT = 'N'
  132.  
  133. return x
  134. /* ------------------------------------------------------------ */
  135. amirc:
  136. arg CD
  137.  
  138. ports = show('P'); pz = 1; f = 0
  139.  
  140. do until ppoz = 0
  141.  
  142.     ppoz = pos('AMIRC.',ports,pz)
  143.      pz = ppoz + 1
  144.      if ppoz ~= 0 then do 
  145.     hst = substr(ports,ppoz,'7')
  146.         address value hst;
  147.     'isconnected'
  148.        if RC = 0 then do 
  149.     'echo P='d2c(27)'b«AmiComSys» User -: 'usr' Has 'CD
  150.     'echo P='d2c(27)'b«AmiComSys» Host -: 'host
  151.     f = 1
  152.        end
  153.      end
  154. end
  155.  
  156. ADDRESS AMICOMSYS
  157.  
  158. return f
  159.